<template>
	<view class="banner-detail">
    <video v-if="item.image && item.image.match(/\.(mp4|mov|avi|wmv)$/i)"
           :src="item.image"
           class="banner-video"
           object-fit="cover"
           :show-center-play-btn="false"
           :controls="true"
           :loop="true"
           :autoplay="true"
    ></video>
    <image v-else :src="item.image" class="banner-image" mode="aspectFill" />
     <u-parse :html="item.content"></u-parse>
	</view>
</template>

<script>
	export default {
		data() {
			return {
        item:{}
			}
		},
    onLoad({ id }) {
      if (id) {
        this.$http.getBannerDetail({ id }).then(res =>{
          this.item = res
        })
      }
    },
		methods: {
			
		}
	}
</script>

<style>
page {
  height: 100%;
  overflow: hidden;
}
.banner-detail {
  height: 100%;
  overflow: auto;
  padding: 24rpx;
}
.banner-video {
  width: 100%;
}
</style>
